#include <Stepper.h>

Stepper st(100,13,12,10,11);
float temp;
declareTaskLoop(motor);
declareTaskLoop(suhu);




taskLoop(motor){
  static int count = 1;
  st.step(100);
  nextTask();
  count ++;
  if(count >= 3){
    count = 0;
    suspend();
  }
}
taskLoop(suhu){
  temp = 110.0 * (unsigned int) analogRead(0) / 1024.0;
  Serial.println(temp);
  delay(200);
  //resumeTask(motor);
}

void setup(){
  analogReference(INTERNAL);
  Serial.begin(9600);
  st.setSpeed(200);
  createTaskLoop(motor, NORMAL_PRIORITY);
  createTaskLoop(suhu, HIGH_PRIORITY);
}
void loop(){
  nextTask();
}
